package com.szqhyxj.youxiangju.biz.receipt.record;

import com.google.gson.annotations.SerializedName;
import com.szqhyxj.youxiangju.biz.receipt.ReceiptModel;
import com.szqhyxj.youxiangju.sys.BaseResult;
import com.szqhyxj.youxiangju.sys.RetrofitFacade;

import java.util.BitSet;
import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by leung on 2018/11/30.
 */

public class ReceiptRecordModel {

    private interface ReceiptRecordServiece {

        @FormUrlEncoded
        @POST("orderquery/getcash")
        Observable<BaseResult<Response>> getReceipt(
                @Field("pageSize") int pageSize,
                @Field("pageNumber") int pageNumber,
                @Field("channelId") String channelId
        );
    }

    public static Observable<BaseResult<Response>> getReceipt(int pageSize,int pageNumber,String channelId) {
        return RetrofitFacade.Companion.getRetrofit().create(ReceiptRecordServiece.class).getReceipt(pageSize,pageNumber,channelId);
    }


    public static class Response {

        @SerializedName("total")
        private int total;

        @SerializedName("rows")
        private List<RowsItem> rows;

        public void setTotal(int total) {
            this.total = total;
        }

        public int getTotal() {
            return total;
        }

        public void setRows(List<RowsItem> rows) {
            this.rows = rows;
        }

        public List<RowsItem> getRows() {
            return rows;
        }

        @Override
        public String toString() {
            return
                    "Response{" +
                            "total = '" + total + '\'' +
                            ",rows = '" + rows + '\'' +
                            "}";
        }
    }
}
